<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>innerText与innerHtml</title>
</head>
<span id="textContent">文本内容</span>
<br>
<span id="htmlContent">标签内容</span>


<body>

</body>

</html>
<script>
    let content = '<a href="http://www.ekgc.cn">课工场</a>';
    window.document.getElementById('textContent').innerText = content;
    window.document.getElementById('htmlContent').innerHTML = content;
</script>